#pragma once

#include<iostream>
#include<string>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
//公共文件
const std::string pipefile = "./fifo";
//权限
const mode_t gmode = 0600;


int comm_openfile(int _fp,int fk)
{
    _fp = open(pipefile.c_str(),fk);//读-打开文件
    if(_fp < 0)
    {
    std::cout << "打开文件失败"<<std::endl;

    }
    std::cout << "打开文件成功"<<std::endl;
    return _fp;
}


    //关闭文件
void comm_closefile(int _fp)
{
    if(_fp > 0)
    {
        ::close(_fp);
    }
}
